<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style type="text/css"></style>
</head>

<body>
  <p id="jss">JACVAVA</p>
  <div id="list">
    <p id="ee">ee</p>
    <p id="se">se</p>
    <p id="ms">ms</p>
  </div>
  <script>
    var ll = document.getElementById('list')
    var nrw = document.createElement('p')
    nrw.id = 's666'
    nrw.innerHTML = 'fssf'
    // 赋值
    ll.append(nrw)
    // 变颜色
    nrw.style.color = 'red'
    var st = document.createElement('style')//设置一个空的style标签
    st.setAttribute('type', 'text/css')//设置style类型,相当于在头部添加了  <style type="text/css"></style>

    st.innerHTML = 'body{background:pink}'//设置标签内容
    document.getElementsByTagName('head')[0].appendChild(st)//0是下标的意思 可以通过document.getElementsByTagName('head') 查看


  </script>
</body>

</html>